Count {Cable Object}

Count

Syntax

SapObject.SapModel.CableObj.Count

VB6 Procedure

Function Count() As Long

Parameters

None

Remarks

This function returns a count of the cable objects in the model.

VBA Example

Sub CountCableObjects()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim ret As Long

Dim Count As Long

Dim Name As String

'create Sap2000 object

Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")

'start Sap2000 application

SapObject.ApplicationStart

'create SapModel object

Set SapModel = SapObject.SapModel

'initialize model

ret = SapModel.InitializeNewModel

'create model from template

ret = SapModel.File.New2DFrame(PortalFrame, 3, 124, 3, 200)

'add cable object by points

ret = SapModel.CableObj.AddByPoint("1", "6", Name)

'return number of cable objects

Count = SapModel.CableObj.Count

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.00.

See Also